<!doctype html> 
<html> 
<head> 
    <meta charset="utf-8"> 
    <title></title> 
</head>
<body>
<div id='div1' name='a'></div>
<script type="text/javascript">
	
	var a = document.getElementById('div1');
	alert(a.getAttribute('name'))
	//alert(div1.name)


</script>
</body>
</html>